import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

/// URL启动工具类
class WangYe {
  /// 打开网页链接
  static Future<void> openUrl(String url) async {
    try {
      final Uri uri = Uri.parse(url);
      if (await canLaunchUrl(uri)) {
        await launchUrl(uri, mode: LaunchMode.externalApplication);
      } else {
        debugPrint("haha");
      }
    } catch (e) {
      debugPrint("dada");
    }
  }
}
